<!--检测点详情分成两个tab页-->
<!--检测点列表其中有个弹窗设置型号等-->
<template>
	<view>
		<!-- <button class="btn" @click="showAdd" size="mini" type="primary">+ &nbsp;新增</button> -->
		<Tab @change="changeParam" :tabList="tabList" :activeIndex="activeIndex"></Tab>
		<view v-if="activeIndex==0">
			<DetectionPointPhoto :detail-info = "detailInfo"></DetectionPointPhoto>
		</view>
		<view v-if="activeIndex==1">
			<detectionPointInfo :detail-info = "detailInfo"></detectionPointInfo>
		</view>
		<view class="test-button">
			<button type="primary" class="mini-btn" @tap="startTest">检测</button>
			<button type="primary" class="mini-btn" @tap="uploadInfo">上传</button>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue"
	import Tab from '@/components/tabs/tabs2.vue';
	import Listscroll from "@/components/list-scroll/list-scroll.vue"
	import {
		onLoad,
	} from "@dcloudio/uni-app";
	import DetectionPointPhoto  from "./detectionPointPhoto.vue"
	import detectionPointInfo   from "./detectionPointInfo.vue"
	import {
		getClassify
	} from "@/api/user.js"
	const params = ref({
		auditStatus: -1
	})
	const types = ref({})
	const status = ref({
		'-1': "待审核",
		1: "已审核",
		0: "已驳回"
	})
	const activeIndex = ref(0)
	const tabList = ref([
		// { tabName: '待审批',  tabId: '-1', id: 0 },
		{
			tabName: '图片信息',
			tabId: 0,
			id: 0
		},
		{
			tabName: '文字详情',
			tabId: 1,
			id: 1
		}
	])
	const detailInfo = ref({})
	const changeParam = (idx) => {
		console.log('idx-===', idx)
		const item = tabList.value.filter(v => v.tabId === idx);
		activeIndex.value = item[0].id;
		console.log('activeIndex===', activeIndex.value)
		params.value.auditStatus = idx;
	}
	const startTest = ()=>{
		uni.navigateTo({
			url: '/pages/testing/testingInformation?info='+ encodeURIComponent(JSON.stringify(detailInfo.value))
		})
	}
	const uploadInfo = () =>{}
	onLoad((option) => {
		if (option) {
			//console.log('option',option.detail);
			detailInfo.value = JSON.parse(JSON.stringify(option.detail));
			console.log('rrtyt',typeof detailInfo)
			//console.log('option4444',detailInfo.value);
			//taskId.value = 
			//params.value.taskId = option.taskId;
		}
	});
</script>

<style lang="scss" scoped>
	.search-content {
		width: 100%;
		height: 100rpx;
		display: flex;
		flex-direction: row;
	}

	.notice-item {
		display: flex;
		flex-direction: column;
		background: #fff;
		border-radius: 10rpx;
		margin: 20rpx 30rpx 0 30rpx;
		padding: 20rpx;
		cursor: pointer;
	}

	.notice-item__title {
		display: flex;
		justify-content: space-between;
		margin-bottom: 10rpx;

		.title {
			font-weight: bold;
			font-size: 28rpx;
			color: #455BDF;
		}

		.type {
			display: inline-block;
			padding: 4rpx 8rpx;
			background: #fef0f0;
			border: 2rpx solid #fde2e2;
			color: rgb(251, 69, 59);
			border-radius: 10rpx;
			font-size: 20rpx;

		}
	}

	.notice-item__containter {
		text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: flex;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		//font-size: 28rpx;
        .item-name{
        	font-size: 20rpx;
        	color: #999;
        }
		.item-value{
			line-height: 1;
		}
	}
	.notice-item__containter-row{
		.item-name{
			font-size: 20rpx;
			color: #999;
		}
		.item-name-two{
			margin-left: 40rpx;
			font-size: 20rpx;
			color: #999;
		}
		.item-value{
			line-height: 1;
		}
	}

	.btn {
		margin: 30rpx 0 0 30rpx;
		height: 80rpx;
		line-height: 80rpx;
		font-size: 28rpx;
	}
	.test-button{
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 25rpx 82rpx;
		background: white;
		z-index: 2;
		box-sizing: border-box;
		padding: 20rpx 30rpx;
		background: rgba(255, 255, 255, 0.6);
		display: flex;
		flex-direction: row;
		uni-button {
			line-height: 80rpx !important;
			font-size: 26rpx;
		}
	}
</style>